package com.bird.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author: bird
 * @Data: 2021/7/14 14:08
 * @description: swagger-ui
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public Docket createRestApi() {

        return new Docket(DocumentationType.SWAGGER_2)
                // 指定测试文档基本信息，这部分将在页面显示
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any()).build();


    }

    private ApiInfo apiInfo() {

        return   new ApiInfoBuilder()
                .title("rabbitmq-消费者")
                .description("rabbitmq-consumer-api")
                .version("1.0-SNAPSHOT")
                .build();
    }


}
